<{extend name="base" /}>
    <{block name="body" }>
        <div class="layui-body ">
            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                    <ul class="layui-tab-title">
                        <li class="">
                            <a href="<{:url('admin/sogou/index')}>">已添加列表</a>
                        </li>
                        <li>
                            <a href="<{:url('admin/sogou/create',['style_id'=>1])}>">样式一</a>
                        </li>
                        <li class="layui-this">
                            <a href="<{:url('admin/sogou/create',['style_id'=>2])}>">样式二</a>
                        </li>
                        <li >
                            <a href="<{:url('admin/sogou/create',['style_id'=>3])}>">样式三</a>
                        </li>
                        <li>
                            <a href="<{:url('admin/sogou/create',['style_id'=>4])}>">样式四</a>
                        </li>
                    </ul>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show" id="app">
                        <div class="left">
                            <form class="layui-form" method="post" action="<{:url('admin/sogou/save')}>">
                                <input type="hidden" name="style" value="2">
                                <{php}>
                                if(request()->action() == 'edit'){
                                    echo '<input type="hidden" name="type" value="edit">';
                                    echo '<input type="hidden" name="id" value="'.request()->get('id').'">';
                                }
                                <{/php}>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">标题</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content[title]"  lay-verify="required" v-model='Btitle' placeholder="{用此符号可飘红，支持多个} 必须成对书写"
                                            class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">标题链接</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content[url]" v-model="Burl" lay-verify="required|url" placeholder="例如：http://baidu.com" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">问题一</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content[data][title1]" v-model="Bstitle1" lay-verify="required" placeholder="{用此符号可飘红，支持多个} 必须成对书写" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">问题一描述</label>
                                    <div class="layui-input-block">
                                        <textarea name="content[data][desc1]" lay-verify="required" v-model='Bdesc1'  placeholder="{用此符号可飘红，支持多个} 必须成对书写"
                                            class="layui-textarea" ></textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">问题一链接</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content[data][url1]" v-model="Bsurl1" lay-verify="required|url" placeholder="例如：http://baidu.com" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">问题二</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content[data][title2]" v-model="Bstitle2" lay-verify="required" placeholder="{用此符号可飘红，支持多个} 必须成对书写" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">问题二描述</label>
                                    <div class="layui-input-block">
                                        <textarea name="content[data][desc2]" lay-verify="required" v-model='Bdesc2'  placeholder="{用此符号可飘红，支持多个} 必须成对书写"
                                            class="layui-textarea" ></textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">问题二链接</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content[data][url2]" v-model="Bsurl2" lay-verify="required|url" placeholder="例如：http://baidu.com" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="right" id="sogou-search">
                            <link rel="stylesheet" href="/sogou/css/style.css" />
                            <div class="vrResult" id="sogou_vr_11014401_4">
                                <h3 class="vr-tit">
                                    <a :href="Burl" class="resultLink land" v-html="Ctitle"></a>
                                </h3>
                                <div class="vr-mingyi160829">
                                    <ul class="myqa-list">
                                        <li class="ping land">
                                            <p class="p1">
                                                <a :href="Bsurl1" v-html="Cstitle1"></a>
                                            </p>
                                            <p class="txt-default clamp3" v-html="Cdesc1"></p>
                                        </li>
                                        <li class="ping land">
                                            <p class="p1">
                                                <a :href="Bsurl2" v-html="Cstitle2"></a>
                                            </p>
                                            <p class="txt-default clamp3" v-html="Cdesc2"></p>
                                        </li>
                                    </ul>
                                    <div class="more-box-new border-top">
                                        <a :href="Burl" class="land part-left cannot">
                                            <img src="">搜狗明医</a>
                                        <a :href="Burl" class="line-whole land">更多医生建议</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <{/block}>
            <{block name="script" }>
                <style type="text/css">
                    .left,
                    .right {
                        float: left;
                    }

                    .left {
                        width: 60%;
                    }

                    .right {
                        height: 550px;
                        margin-left: 60px;
                        width: 300px;
                        border: 2px solid #ccc;
                        border-radius: 20px;
                        padding: 20px;
                        background: #f1f1f1;
                        box-shadow: 1px 2px #eeeeee5c;
                        overflow-y: scroll;
                    }

                    .right::-webkit-scrollbar {
                        display: none;
                    }
                </style>
                <script src="/static/js/vue.js"></script>
                <script type="text/javascript">
                    var vue = new Vue({
                        el: "#app",
                        data: {
                            Btitle: '',
                            Bstitle1: '',
                            Bstitle2: '',
                            Bdesc1:'',
                            Bdesc2:'',
                            Bsurl1: '',
                            Bsurl2: '',
                            Burl: '',
                        },
                        computed: {
                            Ctitle: function () {
                                if (this.Btitle == '') {
                                    return '<em>人流</em>_优质医生回答(1061条)';
                                }
                                return this.Btitle.replace(/{/g, '<em>').replace(/}/g, '</em>');
                            },
                            Cstitle1: function () {
                                if (this.Bstitle1 == '') {
                                    return '七月<em>打胎</em>';
                                }
                                return this.Bstitle1.replace(/{/g, '<em>').replace(/}/g, '</em>');
                            },
                            Cstitle2: function () {
                                if (this.Bstitle2 == '') {
                                    return '<em>人流</em>咨询';
                                }
                                return this.Bstitle2.replace(/{/g, '<em>').replace(/}/g, '</em>');
                            },
                            Cdesc1:function(){
                                if (this.Bdesc1 =='') {
                                    return '<span class="gray-t">[医生回答]</span>七月<em>打胎</em>,正常情况下怀孕后如果想<em>打胎</em>,可以用药物流产的.也可以用<em>人工流产</em>的.但是不能自己在家用药的.指导意见:而且即使是用药物流产也要在医生的指导下用药.而且流掉后还要及时去医院做下复查.';
                                }
                                return '<span class="gray-t">[医生回答]</span>' + this.Bdesc1.replace(/{/g, '<em>').replace(/}/g, '</em>');
                            },
                            Cdesc2:function(){
                                if (this.Bdesc2 =='') {
                                    return '<span class="gray-t">[医生回答]</span><em>人流</em>咨询专家为你解答,咱们<em>人流</em>手术有好几种,适合的<em>人群</em>不一样,费用也是不一样的,一般是结合彩超检查显示孕囊的情况以及您的体质来选择适合的<em>人流</em>手术方式.手术在超导可视的技术引导检测下进行,医生对宫腔内的情况一目了然,可以准确迅速的取出孕囊,不损伤正常的组织,在3-5分钟内便可以安全地完成手术,解决了普通无痛<em>人流</em>的盲目钳刮,容易造成误吸、漏吸等情况,对将来的生育也是没有影响的.我作为<em>人流</em>咨询专家的解答如上,祝健康.';
                                }
                                return '<span class="gray-t">[医生回答]</span>' + this.Bdesc2.replace(/{/g, '<em>').replace(/}/g, '</em>');
                            }
                        }
                    });

                    <{php}>
                        if(request()->action() == 'edit'){

                            echo "vue.Btitle = '".$data['content']['title']."';";
                            echo "vue.Burl = '".$data['content']['url']."';";


                            echo "vue.Bstitle1 = '".$data['content']['data']['title1']."';";
                            echo "vue.Bstitle2 = '".$data['content']['data']['title2']."';";

                            echo "vue.Bsurl1 = '".$data['content']['data']['url1']."';";
                            echo "vue.Bsurl2 = '".$data['content']['data']['url2']."';";

                            echo "vue.Bdesc1 = '".$data['content']['data']['desc1']."';";
                            echo "vue.Bdesc2 = '".$data['content']['data']['desc2']."';";

                            
                        }
                    <{/php}>

                </script>
                <{/block}>